﻿using Microsoft.AspNetCore.Mvc;
using mozhi.smarterp.Business.Products;
using System;
using System.Threading.Tasks;
using Volo.Abp;

namespace mozhi.smarterp.Business.Controllers.Products
{
    [RemoteService]
    [Route("api/v1/products/sale-settings")]
    public class ProductSaleSettingController : BusinessController
    {
        private IProductSaleSettingAppService _appService;

        public ProductSaleSettingController(IProductSaleSettingAppService appService)
        {
            _appService = appService;
        }

        [HttpGet]
        [Route("{productId}")]
        public async Task<ProductSaleSettingDto> GetAsync(Guid productId)
        {
            return await _appService.GetAsync(productId);
        }


        [HttpPost]
        public async Task<ProductSaleSettingDto> CreateAsync(ProductSaleSettingCreateDto input)
        {
            return await _appService.CreateAsync(input);
        }

        [HttpPut]
        public async Task<ProductSaleSettingDto> UpdateAsync(ProductSaleSettingUpdateDto input)
        {
            return await _appService.UpdateAsync(input);
        }

    }
}
